package com.freightoa.foundation.viewmodel

import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow

// 定义一个通用的 ViewModel 接口
//@HiltViewModel
abstract class BaseViewModel<State : BaseState, Intent : UiIntent> :ViewModel(){
//    private val _uiStateFlow = MutableStateFlow(initialState)
//    val uiStateFlow = _uiStateFlow.asStateFlow()
//    abstract  fun handleIntent(intent: Intent)

    abstract val uiState: Flow<State>
    abstract fun handleIntent(intent: Intent)
}